package edu.hawaii.nearestneighbor.util;

import java.util.ArrayList;
import java.util.List;

/**
 * ADT to store feature values with an associated class label (if known).
 * @author Robert Puckett
 *
 */
public class DataPoint {

  /**
   * Feature values.
   */
  public List<Double> x;

  /**
   * State of nature (class).
   */
  public Integer state;
  
  /**
   * Default constructor. 
   */
  public DataPoint() {
    state = null;
    x = new ArrayList<Double>();
  }
  
  /**
   * Constructor with parameters.
   * @param x The feature vector.
   * @param state The state of nature.
   */
  public DataPoint(List<Double> x, Integer state) {
    this.state = state;
    this.x = x;
  }
  
  /**
   * Copy constructor.
   * @param that The DataPoint to be duplicated.
   */
  public DataPoint(DataPoint that) {
    this.state = that.state;
    this.x = new ArrayList<Double>(that.x);
  }  

}
